package com.kly.chatter.api.application.controller.im;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.kly.chatter.api.application.controller.chatter.res.DashboardRes;
import com.kly.chatter.api.application.controller.im.rsp.PpvMessageRsp;
import com.kly.chatter.api.application.service.MessageService;
import com.kly.chatter.api.application.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/message")
@Api(value = "/feedback", tags = "用户im信息反馈")
public class MessageController {

    @Resource
    private MessageService messageService;

    @GetMapping("/feedback")
    @SentinelResource
    @ApiOperation(value = "用户im信息反馈", notes = "dashboard详情")
    public Result<DashboardRes> feedback(@RequestParam @ApiParam("chatter userCode") String userCode, @RequestParam @ApiParam("日期类型 1.当天 2.一周")  int dateType) {
        return Result.ok();
    }

    @GetMapping("/ppvMessage")
    @SentinelResource
    @ApiOperation(value = "ppv IM私聊触发提醒", notes = "ppv IM私聊触发提醒")
    public Result<PpvMessageRsp> ppvMessage(@RequestParam @ApiParam("userCode") String userCode, @RequestParam @ApiParam("ppv类型 1.pp 2.pv") int ppvType) {
       return messageService.ppvMessage(userCode,ppvType);
    }

}
